package com.hp.his.basic.entity;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity 
@Table(name = "QUESTION_CHOICE")
public class Choice {
	private Integer choiceId;
	private String choiceContent;
	private Integer choiceKey;
	private Question question;
	private String choiceTitle;
	
	@Id
	@Column(name="CHOICE_ID")	
	@GeneratedValue(strategy = GenerationType.AUTO)
	public Integer getChoiceId() {
		return choiceId;
	}
	public void setChoiceId(Integer choiceId) {
		this.choiceId = choiceId;
	}
	
	@Column(name="CHOICE_CONTENT", length=4000)
	public String getChoiceContent() {
		return choiceContent;
	}
	public void setChoiceContent(String choiceContent) {
		this.choiceContent = choiceContent;
	}
	
	@Column(name="CHOICE_KEY")	
	public Integer getChoiceKey() {
		return choiceKey;
	}
	public void setChoiceKey(Integer choiceKey) {
		this.choiceKey = choiceKey;
	}	

	@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
	@JoinColumn(name="QUESTION_ID")
	public Question getQuestion() {
		return question;
	}
	public void setQuestion(Question question) {
		this.question = question;
	}
	
	@Transient  
	public String getChoiceTitle() {
		return choiceTitle;
	}
	public void setChoiceTitle(String choiceTitle) {
		this.choiceTitle = choiceTitle;
	}
}
